Skip to content

Add AbortSignal support#13

Merged
rameel merged 1 commit into
mainfrom
abort-signal-support
Apr 7, 2026
Merged

Add AbortSignal support#13
rameel merged 1 commit into
mainfrom
abort-signal-support

Conversation

@rameel

@rameel rameel commented Apr 7, 2026

Copy link
Copy Markdown
Owner

No description provided.

@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown

📦 Bundle size comparison

Name Size Gzip Brotli Δ
hotkey.min.js 1.38 KiB (+16 B) 808 B (+8 B) 696 B (+5 B) 🔴
hotkey.esm.min.js 1.34 KiB (+16 B) 795 B (+8 B) 678 B (+5 B) 🔴

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds AbortSignal-based lifecycle control to hotkey registrations so listeners can be automatically removed when a signal is aborted.

Changes:

  • Pass options.signal through to the underlying addEventListener options in registerHotkey.
  • Add Playwright coverage ensuring hotkeys don’t trigger after a signal aborts (or if already aborted).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/hotkey.ts Forwards AbortSignal to the native event listener options so aborting removes the listener.
tests/hotkey.spec.js Adds tests validating listener behavior when an AbortController is aborted before/after registration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rameel
rameel merged commit 2dc3166 into main Apr 7, 2026
6 checks passed
@rameel
rameel deleted the abort-signal-support branch April 7, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants